/* 
 *   Date       Developer   Description
 *   
 *
 *   Classname:  com.ytincl.scdp.scdk.db.utils.ImportExcel
 * 
 *   Date:   2010-12-28
 * 
 *   The source code contained in this listing is proprietary to
 *   HLJ POST YITONG INFO-NET CO.,LTD.
 * 
 *   Unauthorized copying, adaptation, distribution, use, or display
 *   is strictly prohibited.
 *   This software is Copyright 2010 HLJ POST YITONG INFO-NET CO.,LTD.
 */
package demo.database;

import java.sql.Connection;

import com.titan.core.utils.db.DBUtils;


/**
 *
 *
 * @author Administrator
 *
 */
public class ImportExcel {
    public static void main(String[] args) {
        String[][] config = new String[][] {
//              {"127.0.0.1", "1521", "ORCL", "etms3_base", "etms3_base"},
//              {"127.0.0.1", "1521", "ORCL", "etms3", "etms3"}
              {"10.54.121.248", "1521", "GSCSDB", "etms3_user001", "etms3_user001"}
        };

        try {
            String sql = "select t.receiveaddr,count(*) from mlos_ts_order t group by t.receiveaddr";
            String excel = "c:\\zzz.xls";
            
            
            for (int i = 0; i < config.length; i++) {
                Connection conn = null;
                try {
                    conn = DBUtils.getOracleConnection(config[i][0], config[i][1], config[i][2], config[i][3], config[i][4], true);
//                    DatafileUtil.copyDBToExcel(conn, sql, excel);
                } finally {
                    DBUtils.close(conn);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}

